package com.mezz.bones.im.logic.repository.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mezz.bones.im.logic.domain.entity.ChatGroupMember;
import com.mezz.bones.im.logic.mapper.IChatGroupMemberMapper;
import com.mezz.bones.im.logic.repository.IChatGroupMemberRepository;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 群组成员表 服务实现类
 * </p>
 *
 * @author mezz
 * @since 2025-05-27
 */
@Service
public class ChatGroupMemberRepositoryImpl extends ServiceImpl<IChatGroupMemberMapper, ChatGroupMember> implements IChatGroupMemberRepository {

    @Override
    public ChatGroupMember getByUserIdAndGroupId(String userId, String groupId) {

        return lambdaQuery()
                .eq(ChatGroupMember::getUserId, userId)
                .eq(ChatGroupMember::getGroupId, groupId)
                .one();
    }
}
